package vue;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import javax.swing.AbstractListModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;

import Modele.Parseur;

public class ComboBoxListModel extends DefaultComboBoxModel{

	private final List<Object> l;
	
	public ComboBoxListModel(List<Object> l) {
		this.l = l;
	}
	
	public ComboBoxListModel(Collection<?> cl) {
		l = new LinkedList<Object>();
		for(Object ob : cl)
			l.add(ob);
		//l.addAll(cl);
		//this.l = l;
	}
	
	public Object getElementAt(int index) {
		return l.get(index);
	}
	
	public int getSize() {
		return l.size();
	}
		
	public void fireChange()
	{
		fireIntervalAdded(this, 0, l.size());
	}
}
